package com.dy.design_pattern_study.observer_mode.dome1_coupling;

/**
 * @CreateBy zhangdingyi
 * @Date 2023-04-03
 * @Content
 */
public class client {

    public static void main(String[] args) {
        //前台小姐童子喆
        Secretary tongzizhe = new Secretary();

        //看股票的同事
        StockObserver tongshi1 = new StockObserver("魏关姹", tongzizhe);
        StockObserver tongshi2 = new StockObserver("易管查", tongzizhe);

        //前台记下了两位同事
        tongzizhe.attach(tongshi1);
        tongzizhe.attach(tongshi2);

        //发现老板回来 --做出行动
        tongzizhe.setAction("老板回来了！");

        //通知两个同事
        tongzizhe.notifyObserver();

    }

}
